﻿using System;
using System.Collections.Generic;
using System.Text;

using ATA.Entities;

namespace ATA.Business
{
    public partial class RevenueService : ATA.Business.RevenueServiceBase
    {
        public TList<Revenue> GetAllRevenues(Guid pv_guidCustID, int pv_iYear, int pv_iMonth)
        {
            TList<Revenue> v_lsResults = this.Find("Customer_ID = '" + pv_guidCustID + "' AND YEAR = " + pv_iYear + " AND MONTH = " + pv_iMonth);

            return v_lsResults;
        }

        public TList<Revenue> GetAllRevenues(Guid pv_guidCustID, string pv_strSoHoaDon, int pv_iYear, int pv_iMonth)
        {
            int v_iTotalCount = 0;

            TList<Revenue> v_lsResults = this.GetPaged("Customer_ID = '" + pv_guidCustID 
                                                    + "' AND YEAR = " + pv_iYear 
                                                    + " AND MONTH = " + pv_iMonth
                                                    + " AND Order_Num like '%" + pv_strSoHoaDon + "%'",
                                                    "",
                                                    0,
                                                    1000,
                                                    out v_iTotalCount);
            return v_lsResults;
        }

    }
}
